package com.hitqz.robot.daemon.quartz.controller;

import com.hitqz.robot.common.core.util.R;
import com.hitqz.robot.daemon.quartz.service.TriColourLightService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequiredArgsConstructor
@RequestMapping("/triColourLight")
@Tag(name = "三色灯管理")
@Slf4j
public class TriColourLightController {

    private final TriColourLightService triColourLightService;

    @Operation(summary = "红灯开")
    @GetMapping("redLightOn")
    public R<Void> redLightOn() {
        triColourLightService.redLightOn();
        return R.ok();
    }

    @Operation(summary = "红灯关")
    @GetMapping("redLightOff")
    public R<Void> redLightOff() {
        triColourLightService.redLightOff();
        return R.ok();
    }

    @Operation(summary = "黄灯开")
    @GetMapping("yellowLightOn")
    public R<Void> yellowLightOn() {
        triColourLightService.yellowLightOn();
        return R.ok();
    }

    @Operation(summary = "黄灯关")
    @GetMapping("yellowLightOff")
    public R<Void> yellowLightOff() {
        triColourLightService.yellowLightOff();
        return R.ok();
    }

    @Operation(summary = "绿灯开")
    @GetMapping("greenLightOn")
    public R<Void> greenLightOn() {
        triColourLightService.greenLightOn();
        return R.ok();
    }

    @Operation(summary = "绿灯关")
    @GetMapping("greenLightOff")
    public R<Void> greenLightOff() {
        triColourLightService.greenLightOff();
        return R.ok();
    }

    @Operation(summary = "蜂鸣开")
    @GetMapping("buzzerOn")
    public R<Void> buzzerOn() {
        triColourLightService.buzzerOn();
        return R.ok();
    }

    @Operation(summary = "蜂鸣关")
    @GetMapping("buzzerOff")
    public R<Void> buzzerOff() {
        triColourLightService.buzzerOff();
        return R.ok();
    }
}
